package com.iwop.moto.service.impl;

import com.iwop.moto.model.MBankList;
import com.iwop.moto.service.BaseService;
import com.iwop.moto.service.MBankListService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by mobom on 2016/9/30.
 */
@Service
public class MBankListServiceImpl extends BaseService implements MBankListService {

    @Override
    public void insertMBankList(MBankList mBankList) {
        getSqlSession().insert("MBankListMapper.insert",mBankList);
    }

    @Override
    public void upMBankList(MBankList mBankList) {
        getSqlSession().update("MBankListMapper.update", mBankList);
    }

    @Override
    public List getMBankList(String userId) {
        return getSqlSession().selectList("MBankListMapper.selectByUserId", userId);
    }

    @Override
    public MBankList getMBankListDetail(String userId) {
        return getSqlSession().selectOne("MBankListMapper.selectBySid", userId);
    }

    @Override
    public MBankList selectByUserBankCard(MBankList mBankList){
        return getSqlSession().selectOne("MBankListMapper.selectByUserBankCard", mBankList);
    }

    @Override
    public void deleteMBankList(String userId) {
        getSqlSession().delete("MBankListMapper.deleteMBankList",userId);
    }
}
